package com.xinsilu.hospital.mapper;



import com.xinsilu.hospital.entity.AuthsysOperator;

import static org.apache.ibatis.jdbc.SqlBuilder.*;

public class AuthSysOperatorSqlProvider {

    public String insertSelective(AuthsysOperator record) {
        BEGIN();
        INSERT_INTO("authsys_operator");
        
        if (record.getOptId() != null) {
            VALUES("opt_id", "#{optId,jdbcType=INTEGER}");
        }
        
        if (record.getOptName() != null) {
            VALUES("opt_name", "#{optName,jdbcType=VARCHAR}");
        }
        
        if (record.getOptUrl() != null) {
            VALUES("opt_url", "#{optUrl,jdbcType=VARCHAR}");
        }
        
        if (record.getOptDesc() != null) {
            VALUES("opt_desc", "#{optDesc,jdbcType=VARCHAR}");
        }
        
        return SQL();
    }

    public String updateByPrimaryKeySelective(AuthsysOperator record) {
        BEGIN();
        UPDATE("authsys_operator");
        
        if (record.getOptName() != null) {
            SET("opt_name = #{optName,jdbcType=VARCHAR}");
        }
        
        if (record.getOptUrl() != null) {
            SET("opt_url = #{optUrl,jdbcType=VARCHAR}");
        }
        
        if (record.getOptDesc() != null) {
            SET("opt_desc = #{optDesc,jdbcType=VARCHAR}");
        }
        
        WHERE("opt_id = #{optId,jdbcType=INTEGER}");
        
        return SQL();
    }
}